package com.example.helloffmpeg.system

import android.view.Surface




class RtspPlayer() {
    private var nativeHandle: Long = 0


    init {
        nativeHandle = nativeInit()
    }

    fun release() {
        nativeRelease(nativeHandle)
    }

    fun openStream(url: String): Boolean {
        return nativeOpenStream(nativeHandle, url)
    }

    fun decodeAndPlay(surface: Surface) {
        nativeDecodeAndPlay(nativeHandle, surface)
    }

    private external fun nativeInit(): Long
    private external fun nativeRelease(nativeHandle: Long)
    private external fun nativeOpenStream(nativeHandle: Long, url: String): Boolean
    private external fun nativeDecodeAndPlay(nativeHandle: Long, surface: Surface)
}